% project image onto eigen vectors

function testProjection
    load('bgs.mat');
    load('eigenBG.mat');
    load('testImg.mat');
    load('mean.mat');
    projectionBG = u*(bgs(6,:)-m)';
    projectionTest = u*(img-m)';
    diff = projectionTest - projectionBG ;
    rediff = diff' * u;
    label = zeros(size(rediff));
    label(abs(rediff) < 10) = 1;
    imshow(reshape(label,144,157))
end